from .pub_data import METHODS_INFO, MAP_FUNC


def get_body(method, local) -> dict:
    return {k: local[k] for k in METHODS_INFO[method] if k}


def get_headers(name) -> (dict, int):
    method = MAP_FUNC[name]
    headers = {"method": method, "token": ""}
    return headers, method


def get_headers_body(name, local) -> (dict, dict):
    headers, method = get_headers(name)
    body = get_body(method, local)
    print(headers, body)
    return headers, body


def make_request(self, name, local):
    self._send(*get_headers_body(name, local))
